home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / DRIVES.SWG / 0072_File Allocation Unit Size.pas < prev    next >
Pascal/Delphi Source File  |  1994-05-25  |  1KB  |  21 lines

  1. {
  2.  ▒ Anybody know a realitively easy way to determine the file allocation
  3.  ▒ unit size offa hard/floppy drive??  Pascal source would be prefered over
  4.  ▒ pascal assembly as I know next to nothing about assembly.
  5. }
  6. {───────────────────────────────────────────────────────────────}
  7. Function GetUA(Drive: Byte:LongInt; {0=Default, 1=A, 2=B,..etc .}
  8. Var regs:Registers;
  9. Begin
  10.   regs.ah:=$1C;   { Int 21h, Function 1Ch: Get drive data       }
  11.                   { * Parameters:                               }
  12.   regs.dl:=Drive; {     DL = Drive code                         }
  13.   intr($21,regs); { Call function.                              }
  14.                   { * Returns:                                  }
  15.                   {     AL = Sectors per cluster                }
  16.                   {     DS:DX = Segment:Offset of ID byte       }
  17.                   {     CX = Physical sector length (bytes)     }
  18.                   {     DX = Number of clusters of default unit }
  19.   GetUA:=regs.al*regs.cx; { Returns SPC*SL                      }
  20. End;
  21.